package com.peihongli.dao.impl;

import com.peihongli.dao.UserDao;
import com.peihongli.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Repository;

@Repository("userDao")
public class UserDaoImpl implements UserDao {

    @Override
    public void save() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        User user = (User) applicationContext.getBean("user");
        System.out.println(user);
        System.out.println("执行UserDaoImpl.save()");
    }

    @Override
    public void addUser() {
        System.out.println("执行添加");
    }

    @Override
    public void deleteUser() {
        System.out.println("执行删除");
    }
}
